import {post, upload} from "@/utils/http/axios";
import {baseApi, videoApi, workmanshipApi, constructionApi} from "@/api";

// 1、工地；2、工艺、3、视频
export const SCREEN_CODE = {
    // 工地
    construction: '1',
    // 工艺
    workmanship: '2',
    // 视频
    video: '3',
}

// 基础
export const baseRequest = {
    login: function (params) {
        return post(baseApi.login, params)
    },
    //大屏名称
    NameEdit: function (params) {
        return post(baseApi.NameEdit, params)
    },
    upload: function (fromData) {
        return upload(baseApi.upload, fromData)
    },
    screensaverEdit: function (params) {
        return post(baseApi.screensaverEdit, params)
    },
    screensaverGet: function () {
        return post(baseApi.screensaverGet, {})
    }

}

// 工地
export const constructionRequest = {
    AIJianli: function (params) {
        return post(constructionApi.AIJianli, {...params, screenCode: SCREEN_CODE.construction})
    },
    AIJianliEdit: function (params) {
        return post(constructionApi.AIJianliEdit, {...params, screenCode: SCREEN_CODE.construction})
    },
    Equipment: function (params) {
        return post(constructionApi.Equipment, params)
    },
    EquipmentEdit: function (params) {
        return post(constructionApi.EquipmentEdit, params)
    },
    //小区工地计划
    Plan: function (params) {
        return post(constructionApi.Plan, params)
    },
    PlanEdit: function (params) {
        return post(constructionApi.PlanEdit, params)
    },
    //中间部分获取数量
    GetNum: function (params) {
        return post(constructionApi.GetNum, params)
    },
    NumEdit: function (params) {
        return post(constructionApi.NumEdit, params)
    },
    //地图
    Map: function (params) {
        return post(constructionApi.Map, params)
    },
    MapEdit: function (params) {
        return post(constructionApi.MapEdit, params)
    },
    //施工周期
    WorkDate: function (params) {
        return post(constructionApi.WorkDate, params)
    },
    WorkDateEdit: function (params) {
        return post(constructionApi.WorkDateEdit, params)
    },
    //环境
    env: function (params) {
        return post(constructionApi.env, {...params, screenCode: SCREEN_CODE.construction})
    },
    EnvEdit: function (params) {
        return post(constructionApi.EnvEdit, {...params, screenCode: SCREEN_CODE.construction})
    },
    getName: function () {
        return post(constructionApi.getName, {screenCode: SCREEN_CODE.construction})
    }
}

// 工艺
export const workmanshipRequest = {
    getGongyi: function (params) {
        return post(workmanshipApi.Gongyi, {...params, screenCode: SCREEN_CODE.workmanship})
    },
    // 工艺编辑接口
    setGongyiEdit: function (params) {
        return post(workmanshipApi.gongyiEdit, {...params, screenCode: SCREEN_CODE.workmanship})
    },
    // 验收标准
    getAcceCriteria: function () {
        return post(workmanshipApi.acceCriteria, {screenCode: SCREEN_CODE.workmanship})
    },
    // 验收标准编辑
    setAcceCriteriaEdit: function (params) {
        return post(workmanshipApi.acceCriteriaEdit, {...params, screenCode: SCREEN_CODE.workmanship})
    },
    // 吊顶工艺接口
    getDiaodingVideo: function () {
        return post(workmanshipApi.diaodingVideo, {screenCode: SCREEN_CODE.workmanship})
    },
    // 监理团队接口
    getSupervisorTeam: function () {
        return post(workmanshipApi.supervisorTeam, {screenCode: SCREEN_CODE.workmanship})
    },
    // 施工团队接口
    getWorkerTeam: function () {
        return post(workmanshipApi.workerTeam, {screenCode: SCREEN_CODE.workmanship})
    },
    // 名称编辑接口
    setNameEdit: function (params) {
        return post(workmanshipApi.nameEdit, {...params, screenCode: SCREEN_CODE.workmanship})
    },

    // 吊顶工艺编辑
    setDiaodingVideoEdit: function (params) {
        return post(workmanshipApi.diaodingVideoEdit, {...params, screenCode: SCREEN_CODE.workmanship})
    },
    // 监理团队编辑
    setSupervisorTeamEdit: function (params) {
        return post(workmanshipApi.supervisorTeamEdit, {...params, screenCode: SCREEN_CODE.workmanship})
    },
    // 工地团队编辑
    setWorkerTeamEdit: function (params) {
        return post(workmanshipApi.workerTeamEdit, {...params, screenCode: SCREEN_CODE.workmanship})
    },
    getName: function () {
        return post(workmanshipApi.getName, {screenCode: SCREEN_CODE.workmanship})
    },
    // 下方视频
    setDiaoDingVideoEdit: function (params) {
        return post(workmanshipApi.diaoDingVideoEdit, {...params, screenCode: SCREEN_CODE.workmanship})
    }
}

// 视频
export const videoRequest = {
    // 名称编辑接口
    setNameEdit: function (params) {
        return post(workmanshipApi.nameEdit, {...params, screenCode: SCREEN_CODE.video})
    },
    // 右侧视频接口
    getRightVideoList: function () {
        return post(videoApi.videoGet, {screenCode: SCREEN_CODE.video})
    },
    // 底部视频接口
    getBottomVideoList: function () {
        return post(videoApi.videoWebGet, {screenCode: SCREEN_CODE.video})
    },
    // 直播设置接口
    getLiveSettings: function () {
        return post(videoApi.liveSettingsGet, {screenCode: SCREEN_CODE.video})
    },
    // 右侧假数据上传接口
    setImageUpload: function (params) {
        return post(videoApi.imageUpload, {...params, screenCode: SCREEN_CODE.video})
    },
    // 底部视频上传接口
    setVideoWebUpload: function (params) {
        return post(videoApi.videoWebUpload, {...params, screenCode: SCREEN_CODE.video})
    },
    // 直播设置编辑接口
    setLiveSettingsEdit: function (params) {
        return post(videoApi.liveSettingsEdit, {...params, screenCode: SCREEN_CODE.video})
    },
    // 样板工地编辑接口
    setModelEdit: function (params) {
        return post(videoApi.modelEdit, {...params, screenCode: SCREEN_CODE.video})
    },
    getName: function () {
        return post(workmanshipApi.getName, {screenCode: SCREEN_CODE.video})
    },

}
